package com.zwy.common.exception;

import lombok.Getter;

@Getter
public enum ResultCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    
    // 用户相关错误
    USER_NOT_EXIST(1001, "用户不存在"),
    USERNAME_OR_PASSWORD_ERROR(1002, "用户名或密码错误"),
    DUPLICATE_USERNAME(1003, "用户名已存在"),
    OLD_PASSWORD_ERROR(1004, "原密码错误"),
    
    // 课程相关错误
    COURSE_NOT_EXIST(2001, "课程不存在"),
    COURSE_TASK_NOT_EXIST(2002, "课程目标不存在"),
    CHECK_LINK_NOT_EXIST(2003, "考核环节不存在"),
    
    // 评价相关错误
    EVALUATION_NOT_EXIST(3001, "评价不存在"),
    EVALUATION_ALREADY_EXIST(3002, "已经评价过"),
    
    // 系统错误
    SYSTEM_ERROR(9999, "系统错误");

    private final Integer code;
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}